import { RouteRecordRaw } from 'vue-router';

const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'layout',
    redirect: '/home',
    component: () => import('@/pages/layout/index.vue'),
    children: [],
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/pages/login/login.vue'),
    meta: {
      hidden: true,
    },
  },
  {
    name: '404',
    path: '/404',
    component: () => import('@/pages/error/404.vue'),
    meta: {
      hidden: true,
    },
  },
];

const noFound: RouteRecordRaw = {
  path: '/:catchAll(.*)', // 不识别的path自动匹配404
  redirect: '/404',
  meta: {
    hidden: true,
  },
};

const routes: Array<RouteRecordRaw> = [
  {
    path: '/home',
    name: '首页',
    component: () => import('@/pages/home/home.vue'),
    meta: {
      keepAlive: true,
    },
  }
];
export { routes, staticRoutes, noFound };
